package com.onenine.app.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.onenine.app.R;
import com.onenine.app.model.MemberItem;
import com.onenine.app.utils.GlideUtils;
import com.onenine.app.utils.RoleResLoader;

public class InviteTabAdapter extends BaseQuickAdapter<MemberItem, BaseViewHolder> {

    public InviteTabAdapter() {
        super(R.layout.layout_tab_invite_item);
    }

    @Override
    protected void convert(final BaseViewHolder viewHolder, final MemberItem item) {
        GlideUtils.loadCircleAvatar(viewHolder.getConvertView()
                , viewHolder.getView(R.id.iv_avatar), item.getPhoto());
        viewHolder.setText(R.id.tv_name, item.getNickName());
        viewHolder.addOnClickListener(R.id.btn_invite);
        viewHolder.getView(R.id.btn_invite).setBackgroundResource(RoleResLoader
                .getRoleDrawableResourceId(RoleResLoader.DynamicResName.THEME_GRADIENT_CORNER_BG));
    }

}
